(global.webpackJsonp = global.webpackJsonp || []).push([ [ "wjyk_recycle/pages/transaction/my/grounding/edit/edit" ], {
    "02be": function(t, s, r) {
        (function(a) {
            Object.defineProperty(s, "__esModule", {
                value: !0
            }), s.default = void 0;
            var i = t(r("4795")), o = t(r("5438"));
            function t(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            function u(t, e, n, a, i, o, s) {
                try {
                    var r = t[o](s), u = r.value;
                } catch (t) {
                    return n(t), 0;
                }
                r.done ? e(u) : Promise.resolve(u).then(a, i);
            }
            function e(r) {
                return function() {
                    var t = this, s = arguments;
                    return new Promise(function(e, n) {
                        var a = r.apply(t, s);
                        function i(t) {
                            u(a, e, n, i, o, "next", t);
                        }
                        function o(t) {
                            u(a, e, n, i, o, "throw", t);
                        }
                        i(void 0);
                    });
                };
            }
            var n = {
                data: function() {
                    return {
                        upPicUrl: "https://" + this.$domain + "/app/index.php?i=" + this.$uniacid + "&c=entry&a=wxapp&do=upload&m=wjyk_recycle",
                        categoryList: [],
                        categoryIndex: 0,
                        labelList: [],
                        labelIndex: 0,
                        systemObj: {},
                        obj: {
                            id: "",
                            uid: a.getStorageSync("uid"),
                            category_id: "",
                            category_name: "",
                            label: "",
                            name: "",
                            pic_url: "",
                            price: "",
                            is_bargain: 2,
                            stock: "",
                            desc: "",
                            province: "",
                            city: "",
                            county: "",
                            address: "",
                            consignee: "",
                            consignee_phone: "",
                            wxno: ""
                        }
                    };
                },
                onLoad: function(t) {
                    this.obj.id = t.sid, this.getAddress(), this.getCateList(), this.getLabelList(), 
                    this.getSystem(), this.getDetail();
                },
                onShow: function() {
                    o.default.releaseKey("sellSub");
                },
                methods: {
                    getDetail: function() {
                        var a = this;
                        return e(i.default.mark(function t() {
                            var e, n;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, a.$http({
                                        url: a.$api.tGoodsDetail,
                                        data: {
                                            goodsid: a.obj.id
                                        }
                                    });

                                  case 2:
                                    if (0 != (e = t.sent).errno) {
                                        t.next = 15;
                                        break;
                                    }
                                    a.obj = e.data, e.data.pic_url && setTimeout(function() {
                                        a.$refs.selectimgandupload1.setItems(e.data.pic_url);
                                    }, 500), n = 0;

                                  case 7:
                                    if (!(n < a.categoryList.length)) {
                                        t.next = 15;
                                        break;
                                    }
                                    if (a.obj.category_id == a.categoryList[n].id) return a.obj.category_name = a.categoryList[n].name, 
                                    a.categoryIndex = n, t.abrupt("return");
                                    t.next = 12;
                                    break;

                                  case 12:
                                    n++, t.next = 7;
                                    break;

                                  case 15:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getAddress: function() {
                        var a = this;
                        return e(i.default.mark(function t() {
                            var e, n;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, a.$sun.latlng();

                                  case 2:
                                    return e = t.sent, t.next = 5, a.$sun.location({
                                        key: a.$key,
                                        lat: e.lat,
                                        lng: e.lng
                                    });

                                  case 5:
                                    n = t.sent, a.obj.province = n.address_component.province, a.obj.city = n.address_component.city, 
                                    a.obj.county = n.address_component.district, a.obj.address = n.address, console.log(e, n);

                                  case 11:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getSystem: function() {
                        var n = this;
                        return e(i.default.mark(function t() {
                            var e;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.system
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.systemObj = e.data);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getCateList: function() {
                        var n = this;
                        return e(i.default.mark(function t() {
                            var e;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.tCateList
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.categoryList = e.data);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    getLabelList: function() {
                        var n = this;
                        return e(i.default.mark(function t() {
                            var e;
                            return i.default.wrap(function(t) {
                                for (;;) switch (t.prev = t.next) {
                                  case 0:
                                    return t.next = 2, n.$http({
                                        url: n.$api.transactions
                                    });

                                  case 2:
                                    0 == (e = t.sent).errno && (n.labelList = e.data.set.label);

                                  case 4:
                                  case "end":
                                    return t.stop();
                                }
                            }, t);
                        }))();
                    },
                    imgsChange1: function() {
                        this.$refs.selectimgandupload1.upload();
                    },
                    imgLoaded1: function(t) {
                        try {
                            this.obj.pic_url = "";
                            for (var e = 0; e < t.length; e++) {
                                if (e == t.length - 1) return void (this.obj.pic_url += t[e].url);
                                this.obj.pic_url += t[e].url + ",";
                            }
                        } catch (t) {
                            this.obj.pic_url = "";
                        }
                    },
                    pickChange: function(t) {
                        console.log("----", this.categoryList[t.target.value].name), this.categoryIndex = t.target.value, 
                        this.obj.category_id = this.categoryList[t.target.value].id, this.obj.category_name = this.categoryList[t.target.value].name;
                    },
                    pickChange2: function(t) {
                        this.labelIndex = t.target.value, this.obj.label = this.labelList[t.target.value].name;
                    },
                    switchChange4: function(t) {
                        console.log("switch4 发生 change 事件，携带值为", t.target.value), t.target.value ? this.obj.is_bargain = 1 : this.obj.is_bargain = 2;
                    },
                    submit: function() {
                        var t, n = this;
                        this.obj.province ? this.obj.desc ? this.obj.pic_url ? this.obj.name ? this.obj.category_id ? this.obj.label ? this.obj.stock ? this.obj.price ? this.obj.consignee ? 11 == this.obj.consignee_phone.length ? o.default.uniDoFunc({
                            key: "sellSub",
                            success: (t = e(i.default.mark(function t() {
                                var e;
                                return i.default.wrap(function(t) {
                                    for (;;) switch (t.prev = t.next) {
                                      case 0:
                                        return t.next = 2, n.$http({
                                            url: n.$api.editGoods,
                                            data: {
                                                id: n.obj.id,
                                                uid: a.getStorageSync("uid"),
                                                category_id: n.obj.category_id,
                                                label: n.obj.label,
                                                name: n.obj.name,
                                                pic_url: n.obj.pic_url,
                                                price: n.obj.price,
                                                is_bargain: n.obj.is_bargain,
                                                stock: n.obj.stock,
                                                desc: n.obj.desc,
                                                province: n.obj.province,
                                                city: n.obj.city,
                                                county: n.obj.county,
                                                address: n.obj.address,
                                                consignee: n.obj.consignee,
                                                consignee_phone: n.obj.consignee_phone,
                                                wxno: n.obj.wxno
                                            }
                                        });

                                      case 2:
                                        0 == (e = t.sent).errno ? (a.showToast({
                                            title: e.message,
                                            duration: 1500
                                        }), setTimeout(function() {
                                            a.navigateBack();
                                        }, 1500)) : (n.$sun.toast(e.message), o.default.releaseKey("sellSub")), console.log("防抖... 在事件触发前连续点击事件会重新计时");

                                      case 5:
                                      case "end":
                                        return t.stop();
                                    }
                                }, t);
                            })), function() {
                                return t.apply(this, arguments);
                            })
                        }) : this.$sun.toast("请输入正确的手机号码") : this.$sun.toast("请输入姓名") : this.$sun.toast("请输入商品价值") : this.$sun.toast("请输入商品库存") : this.$sun.toast("请选择商品标签") : this.$sun.toast("请选择商品分类") : this.$sun.toast("请输入商品名称") : this.$sun.toast("请上传商品图片") : this.$sun.toast("请输入商品介绍") : this.$sun.toast("当前定位异常,请检查是否开启GPS");
                    }
                }
            };
            s.default = n;
        }).call(this, r("543d").default);
    },
    "25f7": function(t, e, n) {},
    "2a8a": function(t, e, n) {
        var a = n("25f7");
        n.n(a).a;
    },
    "7a11": function(t, e, n) {
        function a() {
            this.$createElement, this._self._c;
        }
        var i = {
            sunuiUpimg1: function() {
                return n.e("components/sunui-upimg1/sunui-upimg1").then(n.bind(null, "b0f1"));
            },
            sunuiCell: function() {
                return n.e("components/sunui-cell/sunui-cell").then(n.bind(null, "3c51"));
            }
        }, o = [];
        n.d(e, "b", function() {
            return a;
        }), n.d(e, "c", function() {
            return o;
        }), n.d(e, "a", function() {
            return i;
        });
    },
    a3bd: function(t, e, n) {
        n.r(e);
        var a, i = n("7a11"), o = n("c54e");
        for (a in o) "default" !== a && function(t) {
            n.d(e, t, function() {
                return o[t];
            });
        }(a);
        n("2a8a");
        var s = n("f0c5"), i = Object(s.a)(o.default, i.b, i.c, !1, null, null, null, !1, i.a, void 0);
        e.default = i.exports;
    },
    c54e: function(t, e, n) {
        n.r(e);
        var a, i = n("02be"), o = n.n(i);
        for (a in i) "default" !== a && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(a);
        e.default = o.a;
    },
    d2de: function(t, e, n) {
        (function(t) {
            function e(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            n("8163"), e(n("66fd")), t(e(n("a3bd")).default);
        }).call(this, n("543d").createPage);
    }
}, [ [ "d2de", "common/runtime", "common/vendor" ] ] ]);